home *** CD-ROM | disk | FTP | other *** search
/ PC User 2003 January / Disc 3 / Amethyst.iso / live / usr / lib / LST / lisa-update < prev    next >
Encoding:
Text File  |  2002-10-23  |  728 b   |  43 lines

  1. #!/bin/sh
  2.  
  3. Get_all_old_variables()
  4. {
  5.     if [ -f /etc/system.cnf.rpmsave ]; then
  6.         sed -n '/^[^#].*/p' /etc/system.cnf.rpmsave | cut -d'=' -f 1
  7.     fi
  8. }
  9.  
  10. Check_unconfigured_system_cnf()
  11. {
  12.     if [ "`get_val CONF_FQ_HOSTNAME`" != "noname.nodomain.nowhere" ]; then
  13.         return 1
  14.     fi
  15.     if [ ! -f /etc/system.cnf.rpmsave ]; then
  16.         return 1
  17.     fi
  18.     return 0
  19. }
  20.  
  21. # Transfer old configuration into new /etc/system.cnf
  22. Fix_system_cnf()
  23. {
  24.     local i
  25.     local oldval
  26.  
  27.     Check_unconfigured_system_cnf || return 0
  28.     for i in `Get_all_old_variables` ; do
  29.         oldval="`get_val -f /etc/system.cnf.rpmsave $i`"
  30.         case $i in
  31.         CONF_INIT_MAX_FILES|CONF_INIT_MAX_INODES)
  32.             # do not overwrite these
  33.             ;;
  34.         *)
  35.             set_val $i "$oldval"
  36.             ;;
  37.         esac
  38.     done
  39. }
  40.  
  41. Fix_system_cnf
  42.  
  43.